package com.cdu.ai_intelligent_teaching_and_training_system.mapper;

import com.cdu.ai_intelligent_teaching_and_training_system.entity.Assignment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface AssignmentMapper {
    
    // 插入作业
    int insert(Assignment assignment);
    
    // 根据ID查询作业
    Assignment selectById(@Param("assignmentId") Integer assignmentId);
    
    // 根据课程ID查询作业
    List<Assignment> selectByCourseId(@Param("courseId") Integer courseId);
    
    // 查询所有作业
    List<Assignment> selectAll();
    
    // 更新作业
    int update(Assignment assignment);
    
    // 删除作业
    int deleteById(@Param("assignmentId") Integer assignmentId);

    List<Assignment> selectByDueDateBefore(LocalDateTime now);

    List<Assignment> selectByTitleLike(String s);
}
